package com.bootcamp.javase;

/**
 * @program: OopCode
 * @description: a cuboid class
 * @author: Keyu Li
 * @create: 2021-08-27 19:58
 **/

public class Cuboid {
    double length;
    double width;
    double height;

    Cuboid(double length, double width, double height) {
        this.length = length;
        this.width = width;
        this.height = height;
    }

    public double getVolume() {
        return length * width * height;
    }

    public double getSurfaceArea() {
        return (length * width + width * height + height * length) * 2;
    }
}

class CuboidTest{
    public static void main(String[] args) {
        Cuboid cc = new Cuboid(12.2, 13.3, 14.4);
        System.out.println("surface area is "+cc.getSurfaceArea());
        System.out.println("volume is "+cc.getVolume());
    }
}
